package com.jianzh5.page;

import java.util.List;

/**
 * Created by jianzh5 on 2015/7/15.
 */
public class PageView<T> {
    protected List<T> records;  //记录结果集
    private int size;        //每页显示多少条
    private int total;       //总记录数
    private int tpage;       //总页数
    private int cpage;       //当前页数
    private int bindex;      //起始点
    private boolean hasPrepage;
    private boolean hasNextpage;

    public PageView(int size, int total, int tpage, int cpage, int bindex, boolean hasPrepage, boolean hasNextpage) {
        this.size = size;
        this.total = total;
        this.tpage = tpage;
        this.cpage = cpage;
        this.bindex = bindex;
        this.hasPrepage = hasPrepage;
        this.hasNextpage = hasNextpage;
    }

    public PageView(){}

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getTpage() {
        return tpage;
    }

    public void setTpage(int tpage) {
        this.tpage = tpage;
    }

    public int getCpage() {
        return cpage;
    }

    public void setCpage(int cpage) {
        this.cpage = cpage;
    }

    public int getBindex() {
        return bindex;
    }

    public void setBindex(int bindex) {
        this.bindex = bindex;
    }

    public boolean isHasPrepage() {
        return hasPrepage;
    }

    public void setHasPrepage(boolean hasPrepage) {
        this.hasPrepage = hasPrepage;
    }

    public boolean isHasNextpage() {
        return hasNextpage;
    }

    public void setHasNextpage(boolean hasNextpage) {
        this.hasNextpage = hasNextpage;
    }

    public List<T> getRecords() {
        return records;
    }

    public void setRecords(List<T> records) {
        this.records = records;
    }

    @Override
    public String toString() {
        return "PageView{" +
                "records=" + records +
                ", size=" + size +
                ", total=" + total +
                ", tpage=" + tpage +
                ", cpage=" + cpage +
                ", bindex=" + bindex +
                ", hasPrepage=" + hasPrepage +
                ", hasNextpage=" + hasNextpage +
                '}';
    }
}
